package services;

import java.awt.Point;
import java.awt.Rectangle;

import javax.swing.JTable;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;


/** 
 * This part is download from http://jroller.com/santhosh/entry/packing_jtable_columns.
 * 
 * MySwing: Advanced Swing Utilites 
 * Copyright (C) 2005 Santhosh Kumar T
 * This library is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU Lesser General Public 
 * License as published by the Free Software Foundation; either 
 * version 2.1 of the License, or (at your option) any later version. 
 * <p/> 
 * This library is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * Lesser General Public License for more details. 
 * 
 * @author Santhosh Kumar T 
 */
public class MyTable extends JTable{ 
 
    /**
	 * 
	 */
	private static final long serialVersionUID = -6289464502699768484L;

	public MyTable(){
		
	}
	public MyTable(Object[][] rows, Object[] cols){ 
        super(rows, cols); 
    } 
 
    private TablePacker packer = null; 
 
    public void pack(int rowsIncluded, boolean distributeExtraArea){ 
        packer = new TablePacker(rowsIncluded, true); 
        if(isShowing()){ 
            packer.pack(this); 
            packer = null; 
        } 
    } 
 
    public void addNotify(){ 
        super.addNotify(); 
        if(packer!=null){ 
            packer.pack(this);
            packer = null;
        } 
    } 
} 